.TH E1432_SET_XXXX_MODE 3 E1432
.SH NAME
.nf
e1432_set_peak_mode \- Set Peak detection on/off
e1432_get_peak_mode \- Get current state of Peak detection operation
e1432_set_rms_mode \- Set RMS computation on/off
e1432_get_rms_mode \- Get current state of RMS computation operation
.IX e1432_set_peak_mode(3) 3
.IX e1432_get_peak_mode(3) 3
.IX e1432_set_rms_mode(3) 3
.IX e1432_get_rms_mode(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_peak_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 peak_mode)
SHORTSIZ16 e1432_get_peak_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 *peak_mode)
SHORTSIZ16 e1432_set_rms_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 rms_mode)
SHORTSIZ16 e1432_get_rms_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 *rms_mode)
.cE
.SH DESCRIPTION

\fIe1432_set_peak_mode\fR and \fIe1432_set_rms_mode\fR turn on or off
Peak detection and RMS computations, respectively, for the modules(s)
selected.

\fIe1432_get_peak_mode\fR and \fIe1432_get_rms_mode\fR return the state of
Peak detection and RMS computations, respectively,
into a memory location pointed to by \fIpeak_mode\fR and \fIrms_mode\fR,
respectively.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained
with a call to \fIe1432_create_channel_group\fR, or the ID of a single
channel.
It is used to determine which module(s) in \fIhw\fR to set/query.

\fIpeak_mode\fR must be one of
\fBE1432_PEAK_MODE_OFF\fR to turn Peak detection off or
either \fBE1432_PEAK_MODE_BLOCK\fR or \fBE1432_PEAK_MODE_FILT\fR
to turn Peak detection on.
The parameter, 
\fBE1432_RMS_MODE_ON\fR is an alias for \fBE1432_RMS_MODE_BLOCK\fR
and included for backwards compatibility.

\fIrms_mode\fR must be one of
\fBE1432_RMS_MODE_OFF\fR to turn RMS computations off or
either \fBE1432_RMS_MODE_BLOCK\fR or \fBE1432_RMS_MODE_FILT\fR
to turn RMS computations on.
The parameter, 
\fBE1432_RMS_MODE_ON\fR is an alias for \fBE1432_RMS_MODE_BLOCK\fR
and included for backwards compatibility.

Peak detection and RMS computations are only available at
clock frequencies of 65,536 or less.
Peak detection and RMS computations are performed at the full sample rate
even when a lower span has been chosen.
Peak and RMS values are available through the
\fIe1432_get_current_value\fR function and in the trailer.
The choice between \fBE1432_xxxx_MODE_BLOCK\fR or \fBE1432_xxxx_MODE_FILT\fR
determines the computions used to place values in the trailer.

Because of conflicting demands on the module DSP resources, failures may
occur for \fBE1432_PEAK_MODE_BLOCK\fR or \fBE1432_RMS_MODE_BLOCK\fR spans
greater than 5 kHz with order tracking measurements, that is, both
\fIdecimation_output\fR = \fBE1432_MULTIPASS\fR and
\fIdecimation_oversample\fR = \fBE1432_DECIMATION_OVERSAMPLE_ON\fR.
Similarly, \fBE1432_PEAK_MODE_FILT\fR \fBE1432_RMS_MODE_FILT\fR may fail
for spans greater than 10 kHz with order tracking measurements.
If both Peak and RMS computations are turned on, the failures may occur
at lower spans.

Peak detection and RMS computations are currently available only on the E1433.

If either of these parameter are changed while a measurement is running,
the change will not have any effect until the start of the next measurement.
.SH "RESET VALUE"
After a reset, \fIpeak_mode\fR is set to \fBE1432_PEAK_MODE_OFF\fR
and \fIrms_mode\fR is set to \fBE1432_RMS_MODE_OFF\fR.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_set_clock_freq,
e1432_set_peak_decay_time, e1432_set_rms_avg_time, e1432_set_rms_decay_time,
e1432_get_current_value,
e1432_set_weighting
.ad
